package com.ym.medical.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;


/**
 * @Author wenbo
 * @Date 2020/1/8 16:44
 **/

@EnumDescription("医院属性")
public enum HospitalAttributesEnum implements DictEnum {
    //--------------------start-----------------

    /**
     * 公立
     */
    PUBLIC("01","公立"),
    /**
     * 私立
     */
    PRIVATE("02","私立"),

    /**
     * 其他
     */
    OTHER("03","其他"),

    //--------------------end-------------------
    ;

    private String key;

    private String value;

    HospitalAttributesEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    /**
     * 序列化使用
     */
    public static class Covert extends StdConverter<String, JSONObject> {
        @Override
        public JSONObject convert(String value) {
            return DictEnum.valueOfJson(HospitalAttributesEnum.class,value);
        }
    }
}
